/* board_init.h */
#ifndef __BOARD_INIT_H__
#define __BOARD_INIT_H__

#include "hal_common.h"

#include "clock_init.h"
#include "pin_init.h"

#include "hal_gpio.h"
#include "hal_uart.h"
#include "hal_etmr.h"
#include "hal_lptmr.h"
#include "hal_spi.h"
#include "hal_dma.h"
#include "hal_adc.h"


#include "buzzer.h"
#include "ble.h"
#include "motor.h"
#include "ws2812b.h"
#include "monitor.h"

/* uart for debug console. */
#define BOARD_DEBUG_UART_PORT           UART1
#define BOARD_DEBUG_UART_CLK_SRC_HZ     CLOCK_FIRC_FREQ_HZ
#define BOARD_DEBUG_UART_BAUDRATE       115200u

/* buzzer. */
#define BOARD_BUZZER_GPIO_PORT          GPIOA
#define BOARD_BUZZER_GPIO_PIN           0u

/* ble. */
#define BOARD_BLE_DISCONNECT_GPIO_PORT  GPIOA
#define BOARD_BLE_DISCONNECT_GPIO_PIN   3u
#define BOARD_BLE_UART_PORT             UART0
#define BOARD_BLE_UART_CLK_SRC_HZ       CLOCK_FIRC_FREQ_HZ
#define BOARD_BLE_UART_BAUDRATE         115200u

/* motor. */
#define BOARD_MOTORx_PWMx_ETMR_CLK_SRC_HZ     CLOCK_FAST_BUS_CLK_FREQ_HZ

/* ws2812b. */
#define BOARD_WS2812B_SPI_PORT              SPI2
#define BOARD_WS2812B_SPI_CHANNEL           0u
#define BOARD_WS2812B_SPI_CLK_SRC_HZ        (CLOCK_FIRC_FREQ_HZ / 3u) /* 16mzh. */
#define BOARD_WS2812B_LPTMR_PORT            lpTMR0
#define BOARD_WS2812B_LPTMR_IRQn            lpTMR0_IRQn
#define BOARD_WS2812B_LPTMR_IRQHandler      lpTMR0_IRQHandler

/* dma. */
#define BOARD_DMA_WS2812B_SPI_TX_CHANNEL   0u
#define BOARD_DMA_WS2812B_SPI_TX_REQ       DMAMUX_REQ_SPI2_TX
#define BOARD_DMA_WS2812B_IRQn             DMA0_IRQn    
#define BOARD_DMA_WS2812B_IRQHandler       DMA0_IRQHandler



void BOARD_Init(void);

#endif /* __BOARD_INIT_H__ */

